<?php

//  Wtg
//  Copyright (C) 2006 Niels Egberts <niels.egberts@gmail.com>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
//  02111-1307, USA.
	 
DEFINE("IS_GAME", true);
	 
require '../include/connect.php';

$query = '	SELECT c.id, c.citiesname, c.x, c.y, c.citizen, u.username
			FROM cities AS c
			LEFT JOIN users AS u ON c.id = u.id';
$results = mysql_query($query);

echo "<?xml version=\"1.0\"?>\n";
echo "<cities>\n";

while($line = mysql_fetch_assoc($results))
{
	echo "<city id=\"".$line['id']."\" ";
	echo "username=\"".$line['username']."\" ";
	echo "citiesname=\"".$line['citiesname']."\" ";
	echo "xco=\"".$line['x']."\" ";
	echo "yco=\"".$line['y']."\" ";
	echo "citizen=\"".$line['citizen']."\">";
	echo "</city>\n";
}

echo "</cities>";

mysql_close();
	
?>
